<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>登录</title>
		<script type="text/javascript" src="../js/vue-2.6.10.js"></script>
		<script type="text/javascript" src="../js/axios.js"></script>
<style type="text/css">
        * {
    margin: 0;
    padding: 0;
}
body {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	background-image: url(../images/bj.jpg);
    background-repeat: no-repeat;
    background-size: cover;
	}
div.container {
	background: #ccc8;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    width: 300px;
}

div.container > h1 {
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: 5px;
	letter-spacing: 2px;
	user-select: none;
}

div.container > div.input-container {
	margin-bottom:5px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: start;
}

div.container > div.input-container > label {
	margin-bottom: 5px;
	color: rgba(255, 255, 255, 0.8);
	font-size: 15px;
	cursor: pointer;
	user-select: none;
}

div.container > div.input-container > input {
	box-sizing: border-box;
    height: 35px;
    width: 250px;
    border: 1px solid #ccc6;
    padding: 10px;
    border-radius: 5px;
}

div.container > div.input-container > input:focus {
	border: 1px solid rgba(255, 255, 255, 1);
}

div.container > div.button-container {
	width: 250px;
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: nowrap;
    justify-content: space-between;
}


div.container > div.button-container > a {
	width: 100%;
	font-size: 15px;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.6);
	transition: 0.2s;
	user-select: none;
	text-align: end;
}

div.container > div.button-container >a:hover {
	color: rgba(255, 255, 255, 1);
}

div.container > div.button-container > div {
	display: flex;
	flex-direction: row;
	justify-content: center;
	align-items: start;
	margin-top: 20px;
	background-color: #fff6;
}

button {
	width: 250px;
    height: 35px;
    border: 0px solid #ccc6;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    border-radius: 5px;
}
div.container > div.button-container > div > button:nth-of-type(2) {
	margin-left: 10px;
}
span{margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    cursor: pointer;
    user-select: none;}
</style>
	</head>
	<body>
		<div class="container">
			<h1>登入</h1>
            <div class="input-container" id="from">
                <label for="">账号</label>
                <input type="text" v-model="username">
                
                <label for="password">密码</label>
                <input type="password" v-model="password">
                <br>
            	<span v-text="msg"></span>
 				<button type="button" v-on:click="login()">登录</button>
 			</div>
         	<script type="text/javascript">
			let vue =new Vue({
				el:'#from',
				data:{
					username:"",
					password:"",
					msg:""
				},
				created(){
				},methods:{
					login:function(){
						url = '/orderSystem/login.do?username='+vue.username + '&password=' +vue.password;
						axios.get(url).then(
								function(res_obj){
								vue.mag="";
			
								if(res_obj.data){
									window.location.href="index.html";
								}else{
									vue.msg="账号或者密码错误";
								}
							}
						).catch(
								function(error_obj){
									alert("网络连接失败！！！");
								}
						)
					}
				}	
			});
		</script>
        </div>
	</body>
</html>
